using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ImageAnalystTools._ClassificationandPatternRecognition
{
    /// <summary>
    /// <para>Compute Segment Attributes</para>
    /// <para>Computes a set of attributes associated with the segmented image. The input raster can be a single-band or 3-band, 8-bit segmented image.</para>
    /// <para>计算与分割图像关联的一组属性。输入栅格可以是单波段或 3 波段 8 位分割影像。</para>
    /// </summary>    
    [DisplayName("Compute Segment Attributes")]
    public class ComputeSegmentAttributes : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ComputeSegmentAttributes()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_segmented_raster">
        /// <para>Input Segmented RGB Or Gray Raster</para>
        /// <para>The input segmented raster dataset, where all the pixels belonging to a segment have the same converged RGB color. Usually, it is an 8-bit, 3-band RGB raster, but it can also be a 1-band grayscale raster.</para>
        /// <para>输入分段栅格数据集，其中属于分段的所有像素都具有相同的收敛 RGB 颜色。通常，它是 8 位 3 波段 RGB 光栅，但也可以是 1 波段灰度光栅。</para>
        /// </param>
        /// <param name="_out_index_raster_dataset">
        /// <para>Output Segment Index Raster</para>
        /// <para>The output segment index raster, where the attributes for each segment are recorded in the associated attribute table.</para>
        /// <para>输出区段索引栅格，其中每个区段的属性记录在关联的属性表中。</para>
        /// </param>
        public ComputeSegmentAttributes(object _in_segmented_raster, object _out_index_raster_dataset)
        {
            this._in_segmented_raster = _in_segmented_raster;
            this._out_index_raster_dataset = _out_index_raster_dataset;
        }
        public override string ToolboxName => "Image Analyst Tools";

        public override string ToolName => "Compute Segment Attributes";

        public override string CallName => "ia.ComputeSegmentAttributes";

        public override List<string> AcceptEnvironments => ["compression", "extent", "geographicTransformations", "nodata", "outputCoordinateSystem", "parallelProcessingFactor", "pyramid", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_segmented_raster, _out_index_raster_dataset, _in_additional_raster, _used_attributes];

        /// <summary>
        /// <para>Input Segmented RGB Or Gray Raster</para>
        /// <para>The input segmented raster dataset, where all the pixels belonging to a segment have the same converged RGB color. Usually, it is an 8-bit, 3-band RGB raster, but it can also be a 1-band grayscale raster.</para>
        /// <para>输入分段栅格数据集，其中属于分段的所有像素都具有相同的收敛 RGB 颜色。通常，它是 8 位 3 波段 RGB 光栅，但也可以是 1 波段灰度光栅。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Segmented RGB Or Gray Raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_segmented_raster { get; set; }


        /// <summary>
        /// <para>Output Segment Index Raster</para>
        /// <para>The output segment index raster, where the attributes for each segment are recorded in the associated attribute table.</para>
        /// <para>输出区段索引栅格，其中每个区段的属性记录在关联的属性表中。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Segment Index Raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_index_raster_dataset { get; set; }


        /// <summary>
        /// <para>Additional Input Raster</para>
        /// <para>Ancillary raster datasets, such as a multispectral image or a DEM, will be incorporated to generate attributes and other required information for the classifier. This raster is necessary when calculating attributes such as mean or standard deviation. This parameter is optional.</para>
        /// <para>辅助栅格数据集（例如多光谱影像或 DEM）将被合并，以生成分类器的属性和其他所需信息。在计算均值或标准差等属性时，此栅格是必需的。此参数是可选的。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Additional Input Raster")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _in_additional_raster { get; set; } = null;


        /// <summary>
        /// <para>Segment Attributes Used</para>
        /// <para><xdoc>
        ///   <para>Specifies the attributes that will be included in the attribute table associated with the output raster.</para>
        ///   <bulletList>
        ///     <bullet_item>Converged color—The RGB color values will be derived from the input raster on a per-segment basis.</bullet_item><para/>
        ///     <bullet_item>Mean digital number—The average digital number (DN) will be derived from the optional pixel image on a per-segment basis.</bullet_item><para/>
        ///     <bullet_item>Standard deviation—The standard deviation will be derived from the optional pixel image on a per-segment basis.</bullet_item><para/>
        ///     <bullet_item>Count of pixels—The number of pixels composing the segment, on a per-segment basis.</bullet_item><para/>
        ///     <bullet_item>Compactness—The degree to which a segment is compact or circular, on a per-segment basis. The values range from 0 to 1, in which 1 is a circle.</bullet_item><para/>
        ///     <bullet_item>Rectangularity—The degree to which the segment is rectangular, on a per-segment basis. The values range from 0 to 1, in which 1 is a rectangle.</bullet_item><para/>
        ///   </bulletList>
        ///   <para>If the only input into the tool is a segmented image, the default attributes are Average chromaticity color, Count of pixels, Compactness, and Rectangularity. If an Additional Input Raster is also included as an input along with a segmented image, then Mean digital number and Standard deviation are available as options.</para>
        ///   <para></para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将包含在与输出栅格关联的属性表中的属性。</para>
        ///   <bulletList>
        ///     <bullet_item>收敛颜色 - RGB 颜色值将基于每个区段从输入栅格派生。</bullet_item><para/>
        ///     <bullet_item>平均数字数字 - 平均数字数字 （DN） 将基于每个段从可选像素图像派生。</bullet_item><para/>
        ///     <bullet_item>标准差—标准差将基于每个段从可选像素图像派生。</bullet_item><para/>
        ///     <bullet_item>像素计数 - 组成区段的像素数（按每个区段计算）。</bullet_item><para/>
        ///     <bullet_item>紧凑度 - 线段的紧凑度或圆形程度（基于每个线段）。值范围从 0 到 1，其中 1 是一个圆。</bullet_item><para/>
        ///     <bullet_item>矩形 - 线段的矩形程度（按线段计算）。值的范围为 0 到 1，其中 1 是矩形。</bullet_item><para/>
        ///   </bulletList>
        ///   <para>如果工具的唯一输入是分割图像，则默认属性为平均色度颜色、像素数、紧凑度和矩形度。如果附加输入栅格与分割影像一起作为输入也包括在内，则均值数字和标准差可作为选项使用。</para>
        ///   <para></para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Segment Attributes Used")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _used_attributes { get; set; } = null;


        public ComputeSegmentAttributes SetEnv(object compression = null, object extent = null, object geographicTransformations = null, object nodata = null, object outputCoordinateSystem = null, object parallelProcessingFactor = null, object pyramid = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(compression: compression, extent: extent, geographicTransformations: geographicTransformations, nodata: nodata, outputCoordinateSystem: outputCoordinateSystem, parallelProcessingFactor: parallelProcessingFactor, pyramid: pyramid, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}